<template>
    <el-radio-group :disabled="item.attribute.hasOwnProperty('disabled') ? item.attribute.disabled.value : false" v-model="modelValue" :size="item.attribute.hasOwnProperty('componentSize') ? item.attribute.componentSize.value : large">
        <el-radio v-for="(check, checkIndex) in JSON.parse(item.attribute.radioGroupData.extendData)" :key="checkIndex" :label="'' + check.value">{{ check.label }}</el-radio>
    </el-radio-group>
</template>

<script>
export default {
    name: 'RadioGroup',
    props: {
        item: {
            type: Object,
            default: function () {
                return {}
            }
        },
        value: null
    },
    emits: ['update:modelValue'],
    data() {
        return {
            modelValue: []
        }
    },
    watch: {
        modelValue: {
            handler(v) {
                this.$emit('update:modelValue', { value: v })
            },
            deep: true
        }
    },
    methods: {},
    mounted() {
        this.modelValue = this.value ? this.value : ''
    }
}
</script>

<style></style>
